package requests

import (
	"Doge/models"
	"reflect"
)

type Delayed struct {
	Paging
	Name string `json:"name"`
}

type DelayedRequest struct {
	Name    string
	Command string
	Second  int
}

// ValidateJobSortFile 检验字段是否在结构体中
func ValidateJobSortFile(filed string) bool {
	var (
		delayed *models.Delayed
		ele reflect.Type
	)

	delayed = &models.Delayed{}
	ele = reflect.TypeOf(delayed).Elem()
	for i := 0; i < ele.NumField(); i++ {
		if ele.Field(i).Tag.Get("json") == filed {
			return true
		}
	}
	return false
}
